package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.Banner;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BannerDao {
    @Insert("insert into banner(id,`name`,`type`,url,outUrl,`index`,`status`) " +
            "values(#{id},#{name},#{type},#{url},#{outUrl},#{index},#{status})")
    int insert(Banner banner);

    @Select("select * from banner order by `index`")
    List<Banner> query();

    @Select("select * from banner where id=#{id}")
    Banner queryById(String id);

    @Delete("delete from banner where id=#{id}")
    int delete(String id);
}
